1. Technical Field
The present disclosure relates to an image processing technology, and in particular, to a white balance process for digital color images.
2. Description of Related Art
Generally speaking, colors that reflect off an object depend on color of light sources. A human brain is able to detect and correct this type of color change. Whether during a sunny day, a cloudy day, or in a room with light bulbs or fluorescent lamps, a human eye can adapt to the changes in color under different light sources and it will not affect the way in which humans perceive white objects. However, “white color” generated by different light sources is perceived differently by a digital image capturing device. For example, a photo tends to be yellowish if it is taken in a room illuminated with tungsten lamps (light bulbs), and it tends to be lightly bluish or reddish if it is taken in other environments. In order to make the colors in the photos consistent with the colors perceived by human eye, the digital image capturing device has to mimic the human brain and adjust the colors according to the light source. It has to define the white color so that it is the same in the photos as it is in the white color perceived by the human eyes. This type of adjustment is known as “white balance.”
In prior art, a color histogram stretching (CHS) method is used to adjust the white balance for the image, raw histograms of red (R), green (G), and blue (B) three channels are re-quantized to a range of 0-255, adjusted result shows that this method has characteristics with smaller error and immediacy. On the histograms, directions of a larger color scale and a smaller color scale define two identical width ranges as thresholds, average values of the color scale corresponding to pixels within these two thresholds as a reference black and a reference white, separately. Color scale is remapped according to the reference black and the reference white to complete an auto white balance for the image. Under the methodology, the reference black and the reference white can be found, but unknown thresholds of the reference black and the reference white are fixed, thus an obtained reference black and reference white are easily limited and fixed in a certain range. In contrast, when the histogram distribution is normal, the obtained reference black and reference white are relatively stable and less susceptible to noise; but if the main peak of the histogram shifts to left, an excessively large reference white will be obtained. On the contrary, when the main peak of the histogram shifts to right, an excessively small reference black will be obtained. As a result, a contrast of the image is poor after white balance adjustment. Therefore, it is necessary to provide a white balance adjustment method with an adjustable threshold.